package cn.driver.car.mapper;

import cn.driver.common.pojo.Car;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface CarMapper {

    @Select("SELECT carNo, carId, image FROM driving_school.car ")
    List<Car> getCarList();

    @Insert("INSERT INTO driving_school.car (carNo, carId, image) VALUES (#{carNo}, #{carId}, #{image})")
    int addCar(Car car);

    @Update("UPDATE driving_school.car SET carId = #{carId} , image = #{image} where carNo = #{carNo}")
    int updateCar(Car car);

    @Delete("DELETE FROM driving_school.car WHERE carNo = #{carNo}")
    int deleteCar(String carNo);


    @Select("SELECT * FROM car WHERE carNo LIKE '%${carNo}%'")
    List<Car> mohuList(String carNo);

}
